package com.hkbigdata.sybx.mapper;

/**
 * @author yangjing
 * @creat 2025-05-28-9:02
 * @email 3010335359@qq.com
 */

import com.hkbigdata.sybx.bean.UserLoginRecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserLoginRecordMapper {
    // 插入记录
    @Options(useGeneratedKeys = false)
    @Insert("INSERT INTO user_login_record (user_id, login_time) " +
            "VALUES (#{user_id}, #{login_time})")
    int addLoginRecord(UserLoginRecord userLoginRecord);

    // 根据用户ID查询登录记录
    @Select("SELECT * FROM user_login_record WHERE user_id = #{user_id}")
    List<UserLoginRecord> getLoginRecordsByUserId(String user_id);
}